Repository navigation
docs(adrs): [#2842] reject malformed inbound protocol values, with the spec of its first application - #2851
Conversation
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 4e77dd74b38682bab5ff1de95c1095e0e00dbb56. Recomputed from the bytes at this head, against the merge base 388faf59a; git merge-tree against develop 388faf59a writes tree 43bd59c29, the head's own tree, with no conflict.
Process: an ADR plus spec-only issue records, governed by create-adr, create-issue (with fix-bug for the two bug specs) and open-pull-request. The ADR is in docs/adrs/ under a timestamp name, without a status header, with its index row in order; the three specs are folder-style under docs/issues/open/ with complete frontmatter; EPIC #1347 gains a row for #2838.
The change against its claim: the 14 files match the description. The audit in the 2850 spec recomputes: 34 files, about 130 literal constructor calls, every cited line range in primitives, http-protocol, http-core and axum-http-server, and the four historical commits (all on develop, subjects and dates as cited). Its history of the ADR's first text matches the first commit. Two ADR statements describe code that does not exist (F2, F3), and the ADR contradicts itself on what BEP 15 says (F4).
Consistency: every relative link and anchor resolves, every related artifact exists, and the three dictionary words are used in the change. Two quoted section names match no heading (F6, F7).
Hygiene: Conventional subjects with [#N]; author equals committer on all 8 commits; each has one attribution footer line (no rule in the tree on it); git diff --check is clean; the commit-id check prints nothing. The closing-keyword scan matches the intended close of #2842, plus two commit messages and two description sentences that would close #2838 and #2850 on merge (F1).
Findings: F1 Major, F2 Major, F3 Minor, F4 Minor, F5 Minor, F6 Nit, F7 Nit.
Checked, no finding: ADR placement, name and date; the index row; frontmatter keys, status values and spec paths; the HTTP numwant and port parsing as the inventory states it; the probe's packet layout against the BEP 15 offsets; no review threads, so no audit record is due.
Checks
On the loop's compute node at this head, against the merge base 388faf59a (receipt server-gates-kranich-791): the repository's pre-commit gate and lint roster exit 0 and the tree left clean. The PR changes documentation only, so no package tests apply. F1 read on the forge at posting: the pull request's closing references are #2838, #2842 and #2850, and the description says the implementation of #2850 "closes #2850 and #2838". GitHub checks at this head at posting time: "Package Coverage (${{ matrix.package }}): completed/skipped; Package Coverage Regression: completed/success; Test (Docker) (release): in_progress/pending; Docker E2E: completed/skipped; Unit (stable): in_progress/pending; Unit (nightly): completed/success; Layer Boundary Bans: completed/success; Shipped Features: completed/success; Workspace Packaging: completed/success; Documented Clippy Allows: completed/success; Build on macos-latest (stable): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (stable): completed/success; Build on macos-latest (nightly): completed/success; Build on windows-latest (nightly): completed/success; Docs Lint: completed/success; Generate Coverage Report: in_progress/pending; Discover Package Coverage: completed/success". At posting, develop is 388faf59a.
There was a problem hiding this comment.
🟡 Changes recommended
The ADR contains unresolved inaccuracies about protocol handling, affected statistics, implementation status, and where inbound acceptance parity is enforced.
5 open issues
Negative left inflates the seeder count (complete), not completed downloads · New Require parser parity at final inbound acceptance, not parser level · New Reference pending #2850; #2839 was closed without merging · New UDP treats non-positive num_want as maximum; HTTP zero requests none · New HTTP rejects non-IP peer values; distinguish this from the ADR fallback · New
What changed in this PR
This documentation-only PR brings together the inbound-value rejection ADR and the specification for fixing negative byte counts at the domain boundary. It preserves evidence from the superseded tactical patch; production behavior remains unchanged.
Changes:
- Establish strict-by-default handling, evidence requirements for tolerance, and validation ownership.
- Specify private
u64byte-count types, fallible UDP conversion, and corresponding HTTP/REST changes for #2850. - Carry forward #2838 reproduction evidence and update issue tracking and spelling vocabulary.
| File | Description |
|---|---|
project-words.txt |
Adds three research-related terms. |
docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md |
Defines the root fix, decisions, implementation plan, and verification. |
docs/issues/open/2842-inbound-tolerance-adr/ISSUE.md |
Tracks the ADR and its delivery through this PR. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/manual-verification-evidence.md |
Preserves reproduction and unmerged-patch verification results. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/ISSUE.md |
Retains the field audit and marks the tactical plan superseded. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/evidence/udp_announce_probe.py |
Supplies a raw UDP probe for signed counters. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/evidence/tracker.toml |
Records the tracker configuration used for verification. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/evidence/tracker-log-after-fix.txt |
Preserves rejection logs from the tactical patch. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/evidence/red-test-output.txt |
Records the failing regression test. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/evidence/probe-before-fix.txt |
Shows negative left being counted as a seeder. |
docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/evidence/probe-after-fix.txt |
Records probe responses from the unmerged patch. |
docs/issues/open/1347-overhaul-packages-testing/EPIC.md |
Links #2838 to the standalone root-fix issue. |
docs/adrs/index.md |
Registers the inbound-value policy ADR. |
docs/adrs/20261111170611_reject_malformed_inbound_protocol_values_unless_clients_need_tolerance.md |
Defines rejection and tolerance policy, with byte counts as its first application. |
Review effort: Balanced
4e77dd7 to
682a42a
Compare
Twelve findings from two reviews: eleven fixed, one a re-raise. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 4894aaec92f95f52b38bdc5ddfb7421721a1fb9f. Recomputed from the bytes at this head, against the previous round's head 4e77dd74b and the merge base 388faf59a; git merge-tree against develop 388faf59a writes tree d56fc828d, the head's own tree, with no conflict.
What moved: the four commits after 6fb5c832b were reworded with unchanged trees and patches, and eleven commits follow. Against 4e77dd74b five files change (+290/-27), one of them the new audit record; every other path is byte-identical.
Previous findings, all fixed: F1, because the scans of the 19 messages, the title and the description match only Closes #2842. F2 to F7: row 157 matches peer_builder.rs:16 and announce.rs:601-612, line 91 is in the future tense, lines 41-42 agree with 134-136, the superseded marks are in place, and both section references name headings.
The new commits: each claim holds at this head and on develop. The seeder count is at coordinator.rs:231-242. Parity is required at the acceptance boundary, as in AC13 of the 2850 spec. num_want follows announce_handler.rs:252-277, called from udp-core (services/announce.rs:115) and http-core (services/announce.rs:324-325). The HTTP ip rejection is at http-core services/announce.rs:280-291.
Audit record: rows, details, one reply per thread and the log order pass the validator's logic offline against the threads (12 rows, 9 entries, 0 failures). All 12 threads are resolved. Two entries slip (F13, F14).
Hygiene: Conventional subjects; author equals committer on all 19 commits; each has one attribution footer line (no rule in the tree on it); git diff --check is clean; the commit-id check prints the three ids of F13.
Findings: F13 Minor, F14 Nit, F15 Nit, F16 Nit (numbered after the audit's F12); none blocks.
Checked, no finding: the description's History paragraph; the parity wording against points 6 and 8; the UDP ip column (peer_builder.rs:21).
Checks
On the loop's compute node at this head, against the merge base 388faf59a (receipt server-gates-kranich-799): the repository's pre-commit gate and lint roster exit 0 and the tree left clean; the repository's audit validator on pr-2851-review exit 0 (12 rows, 9 log entries, no failures). The PR changes documentation only, so no package tests apply. F1's fix read on the forge at posting: the pull request's only closing reference is #2842. Read on the forge: all 12 review threads are answered and resolved. GitHub checks at this head at posting time: "". At posting, develop is 388faf59a.
…e audit of PR torrust#2851 The processing log cited three ids that the history rewrite replaced. It now cites the commits by subject only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… audit of PR torrust#2851 The log stamped the force push at 19:30 and named the maintainer. The forge records 19:34:12Z and the bot account. The correction is appended; the entry is not rewritten. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Four findings from the approving review, all fixed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Verification remains incomplete because the probe cannot confirm earlier byte counts after subsequent announces, does not check response transaction IDs, and the replay instructions omit creation of the SQLite parent directory.
3 open issues
5 resolved since last review
HTTP rejects non-IP peer values; distinguish this from the ADR fallback UDP treats non-positive num_want as maximum; HTTP zero requests none Reference pending #2850; #2839 was closed without merging Require parser parity at final inbound acceptance, not parser level Negative left inflates the seeder count (complete), not completed downloads
Review effort: Balanced
0ddef28 to
564cb80
Compare
Twelve findings from two reviews: eleven fixed, one a re-raise. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e audit of PR torrust#2851 The processing log cited three ids that the history rewrite replaced. It now cites the commits by subject only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… audit of PR torrust#2851 The log stamped the force push at 19:30 and named the maintainer. The forge records 19:34:12Z and the bot account. The correction is appended; the entry is not rewritten. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Four findings from the approving review, all fixed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three findings from Copilot, all fixed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n the UDP probe Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…exit path Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…its commit time Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ed fix in the sub-issue table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the probe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… PR torrust#2851 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… audit of PR torrust#2851 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…udit of PR torrust#2851 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
989dcf2 to
4b2a10b
Compare
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 4b2a10bb2d7a93e70158d53327ab0fc1fa4e754b. Recomputed from the bytes at this head, against the previous round's head 989dcf2c5, its merge base ec1f58ec9 and the new merge base 1bb188769; git merge-tree against develop ef759e33d writes tree f1d6eb9fc with no conflict.
What moved: the branch was rebased onto 1bb188769 and force-pushed at 12:19:04Z. git range-diff shows all 52 commits replayed in order with the same changes. 50 are identical; commits 5 and 43 differ only in a context line of the EPIC of issue 1347, whose row 11 develop changed. The per-path patches against each base are identical apart from that context line, and the audit, the specs, the evidence and the ADR are byte-identical to 989dcf2c5. Author times are kept; committer times are now 12:12:28Z to 12:12:58Z.
Previous findings: none open. This account's series F1 to F50 and F59 stays fixed (F47, F49 and the drafts F58 and F61 are unused).
The rewrite's records: all 61 threads are answered, recorded and resolved, the validator's logic passes offline (61 rows, 31 entries, 0 failures), and the commit-id check prints nothing. But the rewrite is recorded nowhere: the description still says the branch was rebased "once", and the audit has no entry for it (F62). The log's %cI citations also no longer hold (F63).
Hygiene: Conventional subjects, no bodies, and one attribution footer line each (no rule in the tree on it); author = committer on all 52 commits; git diff --check is clean.
Findings: F62 Minor; F63 Nit. Neither blocks: both are records the author can correct.
Checks
On the loop's compute node at this head, against the new merge base 1bb188769 (receipt server-gates-kranich-885): the repository's pre-commit gate and lint roster exit 0 (76 s wall); the repository's audit validator on pr-2851-review exits 0 (61 rows, 31 log entries, no failures). The PR changes documentation and an evidence script only, so no package tests apply. The rebase checked against the bytes at posting: git range-diff pairs 50 of the 52 commits as identical and the other two as changed, in a context line only. Read on the forge: all 61 review threads are answered and resolved. GitHub checks at this head at posting time: "". At posting, develop is ef759e33d.
|
Commit ids cited in the reviews of this pull request, mapped to commit subjects. The branch was rebased onto
🤖 Generated with Claude Code |
…orrust#2851 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ACK 5af3b9f |
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 5af3b9f18ce3b84b31c0fb60ed6538a7d79c4bcc. Recomputed from the bytes at this head, against the previous round's head 4b2a10bb2 and the merge base 1bb188769; git merge-tree against develop ef759e33d writes tree f9e264b2c with no conflict.
What moved: two commits fast-forward 4b2a10bb2, both audit only. f8580ac75 records the second rebase, with a pointer to the PR comment that maps the cited ids to subjects, and corrects the %cI citations; the description's History now states the second rebase. 5af3b9f18 records round 14: rows and entries F62 and F63, an overview line, and a log entry. The other 2,580 paths are byte-identical to 4b2a10bb2.
Previous findings, changed since the last review:
- F62: fixed. The rebase reason holds (
989dcf2c5conflicts with1bb188769in the EPIC). Each of the mapping comment's 32 ids names the commit whose subject it gives, that subject is on the branch once, and every off-branch id the reviews cite is mapped. - F63: fixed; the correction holds.
F1 to F50 and F59 stay fixed.
The new commits: rows F62 and F63 match the forge (sources, [Minor] and [Nit] brackets, reviewer-provided IDs with N/A, and replies on their own threads after the push). The round-14 entry's times hold, with the resolutions stated as a later step. All 63 threads are answered, recorded and resolved. The validator's logic passes offline (63 rows, 34 entries, 0 failures), and the commit-id check prints nothing.
Hygiene: Conventional subjects, no bodies, and one attribution footer line each (no rule in the tree on it); author = committer on all 54 commits; git diff --check is clean.
Findings: none.
Checks
On the loop's compute node at this head, against the merge base 1bb188769 (receipt server-gates-kranich-887): the repository's pre-commit gate and lint roster exit 0 (132 s wall); the repository's audit validator on pr-2851-review exits 0 (63 rows, 34 log entries, no failures). The round's commits change the audit record only, so no package tests apply. Read on the forge: all 63 review threads are answered and resolved. GitHub checks at this head at posting time: "Package Coverage (${{ matrix.package }}): completed/skipped; Package Coverage Regression: completed/success; Docs Lint: completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Docker E2E: completed/skipped; Layer Boundary Bans: completed/success; Unit (nightly): in_progress/pending; Documented Clippy Allows: completed/success; Shipped Features: completed/success; Unit (stable): in_progress/pending; Workspace Packaging: completed/success; Generate Coverage Report: in_progress/pending; Discover Package Coverage: completed/success; Test (Docker) (release): in_progress/pending". At posting, develop is 0ac5e35eb.
|
ACK 5af3b9f |

Closes #2842
Related to #2850
Related to #2838
Docs only: no production code changes. The only script touched is the disposable UDP probe in the evidence folder of #2838. This is the spec-only pull request of #2850. It replaces #2843 (the ADR) and the documents of #2839 (the tactical patch), which are closed without merging.
What
docs/adrs/), its index entry and its issue specification. The four commits of docs(adrs): [#2842] reject malformed inbound protocol values unless real clients need the tolerance #2843 are carried over unchanged, with one more commit that points the ADR at Make the number of bytes non-negative by construction #2850 as its first application, and the fix commits of the review rounds.docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md). It addresses the bug of UDP tracker accepts announces with a negative left, uploaded or downloaded #2838 at its root.project-words.txt.docs/pr-reviews/pr-2851-review/PR-REVIEW.md.Why one pull request
The patch, the ADR and the design were three views of one decision, worked on in three sessions. The maintainer decided on 2026-11-12 to review the decision documents together and to address the bug of #2838 at its root instead of merging a patch that the next change would delete.
The decisions recorded (maintainer, 2026-11-12)
NumberOfBytesholds a privateu64, with no upper bound.Request::parse_bytesare not changed; a negative counter is refused at the first conversion into a type the project owns (peer_builder::from_requestinudp-core).UdpAnnounceErrorwraps it. No standalone validation function.u64and itsi64::MAXlimit is removed; the REST fields becomeu64. Wire ranges may differ per protocol; the domain is the same for both.The specification of #2850 has a section "Sources for the Decisions" that maps each question of the review to the ADR or document that answers it.
Files
docs/adrs/20261111170611_reject_malformed_inbound_protocol_values_unless_clients_need_tolerance.md,docs/adrs/index.mddocs/issues/open/2842-inbound-tolerance-adr/ISSUE.mddocs/issues/open/2850-non-negative-number-of-bytes/ISSUE.mddocs/issues/open/2838-1347-udp-reject-negative-announce-bytes/(specification, evidence, probe)docs/issues/open/1347-overhaul-packages-testing/EPIC.mdproject-words.txtValidation
linter markdown,linter cspellandlinter lycheepass.developreports nothing.History
The history of this branch was rewritten once, during the first review round, to reword two commit messages that paired a closing keyword with #2838: "docs(issues): [#2838] carry over the spec and evidence from PR #2839" and "docs(adrs): [#2842] point the inbound tolerance ADR at issue #2850". No commit was dropped, squashed or reordered, and the tree at the rewritten head was identical to the tree before. The review audit names the commits the first review cites by their subjects.
The branch was then rebased onto
developtwice. The first rebase was needed because #2841 changed the row next to the one this pull request adds to the sub-issue table of EPIC #1347. The conflict was resolved by keeping the row ofdevelopand adding the #2838 row after it; every commit was replayed in the same order.The second rebase, after the approval of round 13, was needed for the same reason: #2852 changed that row again and the pull request conflicted with
develop. The conflict was resolved the same way, and all commits were replayed in the same order with the same changes. The commit ids that the review comments cite no longer name commits on the branch; this comment maps each one to its commit subject.Not in this pull request
2838-udp-reject-negative-announce-bytes.🤖 Generated with Claude Code